package com.sicaolong.sqlSession;

import com.sicaolong.config.XMLConfigBuilder;
import com.sicaolong.pojo.Configuration;
import org.dom4j.DocumentException;

import java.beans.PropertyVetoException;
import java.io.InputStream;

/**
 * @author : sicaolong
 * @description :
 * @date : 2020/10/15  11:53 下午
 */
public class SqlSessionFactoryBuilder {
	public SqlSessionFactory build(InputStream in) throws PropertyVetoException, DocumentException {
		//1、使用dom4j解析配置文件，将解析出来的内容封装到Configuration中
		XMLConfigBuilder xmlConfigBuilder = new XMLConfigBuilder();
		Configuration configuration = xmlConfigBuilder.parseConfig(in);
		//2、创建SqlSessionFactory对象  工厂类：生产sqlSession对象
		DefaultSqlSessionFactory defaultSqlSessionFactory = new DefaultSqlSessionFactory(configuration);
		return null;
	}

}